﻿using Json测试.测试类;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Json测试
{
    class Program
    {
        static void Main(string[] args)
        {
            AnimalBaseInfo abi = new AnimalBaseInfo(10,20);
            string jsonStr = JsonHelper.ToJSON(abi);
            Debug.Print(jsonStr);

            AnimalBaseInfo abi2 = JsonHelper.FromJSON<AnimalBaseInfo>(jsonStr);
            Debug.Print(abi2.Hight.ToString());
            Debug.Print(abi2.Color.ToString());

            Debug.Print("************************************************");
            Debug.Print("************************************************");
            Debug.Print("************************************************");

            DogInfo dogInfo = new DogInfo(true);
            jsonStr = JsonHelper.ToJSON(dogInfo);
            Debug.Print(jsonStr);

            DogInfo dogInfo2 = JsonHelper.FromJSON<DogInfo>(jsonStr);
            Debug.Print(dogInfo2.Hight.ToString());
            Debug.Print(dogInfo2.Color.ToString());
            Debug.Print(dogInfo2.Limbs.ToString());

            Debug.Print("************************************************");
            Debug.Print("************************************************");
            Debug.Print("************************************************");

            List<DogInfo> dogInfos = new List<DogInfo>();
            dogInfos.Add(new DogInfo(true));
            dogInfos.Add(new DogInfo(false));
            dogInfos.Add(new DogInfo(true));
            dogInfos.Add(new DogInfo(false));
            jsonStr = JsonHelper.ToJSON(dogInfos);
            Debug.Print(jsonStr);
        }
    }
}
